package dao

import (
	"github.com/sirupsen/logrus"
	"morleyStoneHome/model"
)

type walletDeviceUidDao struct{}

var WalletDeviceUidDao = newWalletDeviceUidDao()

func newWalletDeviceUidDao() *walletDeviceUidDao {
	return &walletDeviceUidDao{}
}

func (w *walletDeviceUidDao) FindOne(uid string) (wdu []model.WalletDeviceUid, err error) {
	res := Db.Where("uid = ? and wallet = ?", uid, "ERC20").Find(&wdu)
	if res.Error != nil {
		logrus.Error(res.Error)
		return nil, res.Error
	}
	return wdu, nil
}
